<?php
	if ($arrCommunity['ID_user'] == $idUser)
		echo '
			<ul class="right_botron">
				<li><a class="redact_statua" href="' . W_ABSPATH . 'community/edit/' . $idCommunity . '/">Изменить изображение</a></li>
			</ul>';
		
	if ($idUser)
		echo '
			<ul class="right_botron">
				<li><a class="lesons" href="' . W_ABSPATH . 'newArticle/' . $idCommunity . '">Добавить cтатью</a></li>
				<li><a class="lesons" href="' . W_ABSPATH . 'tutorial/lesson/add?idFolder=' . $idCommunity . '">Добавить урок</a></li>
				<!--<li><a class="lesons" href="' . W_ABSPATH . 'tutorial/add?idFolder=' . $idCommunity . '">Добавить самоучитель</a></li>-->
				<li><a class="lesons" href="' . W_ABSPATH . 'question/add/' . $idCommunity . '">Добавить вопрос</a></li>
				<li><a class="lesons" href="' . W_ABSPATH . 'solution/add/' . $idCommunity . '">Добавить готовое решение</a></li>
			</ul>';
		
require_once(TEMPLATE . 'columns/banner.php');

		
	echo '
	<h3>Статистика сообщества</h3>
	<div class="stats">
		<ul>
			<li class="kol_prosmotr">Количество просмотров: <strong>' . $arrCommunity['browsing_amount'] . '</strong></li>
			<li class="prosmotrelo"> Посмотрело: <strong>' . $arrCommunity['visitors'] . '</strong></li>
			<li class="comentaruev">Комментариев: <strong>' . $arrCommunity['comment_amount'] . '</strong></li>
		</ul>
	</div>';
if (!empty($arrQuestion)){
	echo '
		<!--start voprosu-->	
		<h3>Последние вопросы</h3>';
	foreach ($arrQuestion as $arr){
		echo '	
		<div class="last_article">
			<span class="last_acticle_last">' . Service_Date::getCaseDateForUser($arr['creation']) . '</span>
			<ul>' . ($arr['show_folder'] == 0 ? '<li><a href="' . W_ABSPATH . 'questions?folder=' . $arr['ID_root_folder'] . '&pageNum=1">' . $arr['root_folder_name'] . '</a></li>' : NULL) . '
				<li><a href="' . W_ABSPATH . 'questions?folder=' . $arr['ID_folder'] . '&pageNum=1">' . $arr['folderName'] . '</a></li>
				<li class="last"><a href="' . W_ABSPATH . 'question/' . $arr['ID_question'] . '">' . $arr['name'] . '</a></li>
			</ul>
		</div>';
	}
}


if (!empty($arrLesson)){	
	echo '
		<!--end voprosu-->
		<!--start yroku-->
		<h3>Последние уроки</h3>';
	foreach ($arrLesson as $arr){
		echo '	
		<div class="last_article">
			<span class="last_acticle_last">' . Service_Date::getCaseDateForUser($arr['creation']) . '</span>
			<ul>
				<li><a href="' . W_ABSPATH . 'tutorials?idFolder=' . $arr['ID_folder'] . '&pageNum=1">' . $arr['folder_name'] . '</a></li>
				<li><a href="' . W_ABSPATH . 'tutorial/' . $arr['url_name'] . '">' . $arr['tutorial_name'] . '</a></li>
				<li><a href="' . W_ABSPATH . 'tutorial/' . $arr['url_name'] . '/theme/' . $arr['ID_tutorial_theme'] . '/1">' . $arr['theme_name'] . '</a></li>
				<li class="last"><a href="' . W_ABSPATH . 'tutorial/' . $arr['url_name'] . '/lesson/' . $arr['ID_tutorial_lesson'] . '">' . $arr['lesson_name'] . '</a></li>
			</ul>
		</div>';
	}
}
echo '
	<!--end yroku-->';
  
?>